function price = priceEuropeanOption(type, S, X, T, r, b, v)
    % Price European options using Black-Scholes model

    d1 = (log(S / X) + (b + v^2 / 2) * T) / (v * sqrt(T));
    d2 = d1 - v * sqrt(T);

    if strcmp(type, 'Call')
        price = S * exp((b - r) * T) * normcdf(d1) - X * exp(-r * T) * normcdf(d2);
    elseif strcmp(type, 'Put')
        price = X * exp(-r * T) * normcdf(-d2) - S * exp((b - r) * T) * normcdf(-d1);
    end
end

